var t = getApp();

Page({
  data: {
    tabArr: {
      curHdIndex: 2,
      curBdIndex: 0
    },
    jia: "+",
    jian: "",
    currentResult: 0
  },
  particulars: function(t) {
    console.log(t.currentTarget.dataset.id), wx.setStorageSync("particularsid", t.currentTarget.dataset.id),
      wx.navigateTo({
      url: "/hyb_yl/backstageServicess/pages/particulars/particulars"
      });
  },
  tab: function(t) {
    var a = t.currentTarget.id,
      e = {};
    e.curHdIndex = a, e.curBdIndex = a, this.setData({
      tabArr: e,
      currentResult: 0,
      onFlag: !1
    }), this.onclick();
  },
  onLoad: function(options) {
    var a = this;
    wx.getSystemInfo({
      success: function(t) {
        a.setData({
          height: .98 * t.windowHeight
        });
      }
    });
    let b = options.id;
    if( b == 0) {
      wx.setNavigationBarTitle({
        title: '处方明细'
      })
    }
    if (b == 1) {
      wx.setNavigationBarTitle({
        title: '挂号明细'
      })
    }
    if (b == 2) {
      wx.setNavigationBarTitle({
        title: '在线咨询明细'
      })
    }
    if (b == 3) {
      wx.setNavigationBarTitle({
        title: '图文咨询明细'
      })
    }
  },
  onShow: function() {
    // this.setData({
    //     onFlag: !1
    // }), 
    this.onclick();
  },
  onclick: function(a) {
    // this.setData({
    //     moreFlag: !1
    // });
    // var e = this, r = wx.getStorageSync("log") || "";
    // wx.request({
    //     url: t.globalData.dic + "doctor/personal/moneyBagDetail",
    //     data: {
    //         token: r,
    //         currentResult: 0,
    //         type: e.data.tabArr.curHdIndex
    //     },
    //     success: function(t) {
    //         t.data.data.details || e.setData({
    //             onFlag: !0
    //         }), e.setData({
    //             arr: t.data.data.details,
    //             currentResult: t.data.data.page.nextResult
    //         });
    //     }
    // });
    let that = this;
    let c = {
      flowDesc: '小红',
      money: 1,
      createTime: '2018-10-23',
      id: 1,
      orderType: 1
    };
    let cc = {
      flowDesc: '小明',
      money: -10000,
      createTime: '2018-10-23',
      id: 1,
      orderType: 1
    };
    let ccc = {
      flowDesc: '小花',
      money: 100,
      createTime: '2018-10-23',
      id: 1,
      orderType: 1
    };
    let b = [c, cc, ccc, c];
    that.setData({
      arr: b
    })
  },
  lower: function() {
    if (!this.data.moreFlag && !this.data.closureFlag) {
      this.setData({
        closureFlag: !0
      });
      var a, e = this,
        r = wx.getStorageSync("log") || "",
        n = (e.data.jia, e.data.currentResult),
        s = e.data.arr;
      wx.request({
        url: t.globalData.dic + "doctor/personal/moneyBagDetail",
        data: {
          token: r,
          currentResult: n,
          type: e.data.tabArr.curHdIndex
        },
        success: function(t) {
          if (200 == t.data.code) {
            e.setData({
              currentResult: t.data.data.page.nextResult
            });
            var r = t.data.data.details;
            if (a = s.concat(r), null == r) return e.setData({
              moreFlag: !0,
              closureFlag: !1
            }), !1;
            wx.showLoading({
              title: "加载中",
              icon: "loading"
            }), e.setData({
              arr: a,
              closureFlag: !1
            }), setTimeout(function() {
              wx.hideLoading();
            }, 1500);
          }
        }
      });
    }
  }
});